import { Component } from "react";
import {
    MIcon
} from "../Components/Common";
import {
    Point
} from "../Cloud";
import {
    notification
} from "antd";

interface State {
    Icon: any;
}
interface Props {
    maps: any;
}
export default class Points extends Component<Props, State> {
    componentDidMount() {
        this.init();
    }
    init = () => {

    }
    startClickOn = () => {
        this.props.maps.MapOn(
            'singleclick',
            (e: any) => {
                let Icon = Point.Icons({
                    Source: [{
                        longitude: e.longitude,
                        latitude: e.latitude,
                    }]
                });
                this.setState({
                    Icon
                });
            }
        )
        this.setMouseState(true);
    }
    setMouseState = (type: boolean) => {
        type ? (
            document.body.style.cursor = "crosshair"
        ) : (
            document.body.style.cursor = "default"
        );
    }
    notification = () => {
        const args = {
            message: '点位绘制',
            description:
                <div>
                </div>,
            duration: 0,
        };
        notification.open(args);
    }
    render() {
        return <>

            <MIcon
                url={''}
                onClick={() => {

                }}
            />
        </>
    }
}

